function App() {

    // Promise Ajax
    this.Ajax = function (options) {
        return new Promise((resolve, reject) => {
            if (typeof $ === 'undefined'){
                console.warn("Jquery Is Required, Please Make Sure You Are Import");
                reject(null, null, null);
            }
            options.success = function (data, response, code) {
                resolve(data, response, code);
            };
            options.error = function (data, response, code) {
                reject(data, response, code);
            };
            $.ajax(options);
        });
    };

    // 获取元素
    this.getEl = function (query, index = false) {
        if (typeof query === 'undefined' || query === ''){
            return null;
        }
        let parsed = /^(#|\?|.|~)([A-z]+)$/.exec(query);
        switch (parsed[1]) {
            case "#":
                return document.getElementById(parsed[2]);
            case "?":
                if (index !== false){
                    return document.getElementsByTagName(parsed[2])[index];
                }else{
                    return document.getElementsByTagName(parsed[2]);
                }
            case ".":
                if (index !== false){
                    return document.getElementsByClassName(parsed[2])[index];
                }else{
                    return document.getElementsByClassName(parsed[2]);
                }
            case "~":
                if (index !== false){
                    return document.getElementsByName(parsed[2])[index];
                }else{
                    return document.getElementsByName(parsed[2]);
                }
        }
    };

    // 克隆Object
    this.ObjClone = function (obj) {
        return JSON.parse(JSON.stringify(obj));
    };

    //

}